<template>
  <a-modal
    title="查看字典详情"
    :width="800"
    :visible="visible"
    :footer="null"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="名称"
        >
          <p>{{ details.name }}</p>
        </a-form-item>

        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="字典名称"
        >
          <p>{{ details.dictKey }}</p>
        </a-form-item>

        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="字典值"
          hasFeedback
        >
          <p>{{ details.dictValue }}</p>
        </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="字典值"
        >
          <p>{{ details.description }}</p>
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>

<script>
export default {
  name: 'ViewDictionaryModal',
  data () {
    return {
      visible: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      confirmLoading: false,
      details: {},
      form: this.$form.createForm(this)
    }
  },

  methods: {
    check (record) {
      this.details = Object.assign({}, record)
      console.log('接收列表行参数-----', this.details)
      this.visible = true
    },

    handleCancel () {
      this.visible = false
    }
  }
}
</script>
